<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">


     <div class="container-div">
		 <div >
			 <h1>企业信息</h1>
			 <h2 class="row">
				 <div class="col-xs-3">
					 <small >企业名称 ：</small>
					 <small class=" l-companyName" th:text="${company.companyName}"></small>
				 </div>
				 <div class="col-xs-3">
					 <small   class="">机构代码 :  </small>
					 <small class=" l-companyOrgNum" th:text="${company.companyOrgNum}" ></small>
				 </div>
				 <div class="col-xs-3">
					 <small>联系人 : </small>
					 <small class="l-connectPeople" th:text="${company.connectPeople}"> </small>
				 </div>
				 <div class="col-xs-3">
					 <small   class="">联系人身份证号 :  </small>
					 <small class=" l-companyOrgNum" th:text="${company.idCardNum}" ></small>
				 </div>
			 </h2>
			 <h2 class="row">
				 <div class="col-xs-3">
					 <small >联系方式 ： </small>
					 <small class="l-connectPeople" th:text="${company.companyPhone}"></small>
				 </div>
				 <div class="col-xs-3">
					 <small >企业所在地市行政区划分 ： </small>
					 <small class="l-connectPeople" th:text="${company.companyLocationCode}"></small>
				 </div>
				 <div class="col-xs-3">
					 <small >详细地址 : </small>
					 <small class="  l-companyAddress" th:text="${company.companyAddress}" ></small>
				 </div>

				 <div class="col-xs-3">
						<small>申请返回时间 ：</small>
						<small class="l-companyApplyTime"  th:text="${pc.remark}"> </small>
				 </div>
			 </h2>
			 <h2>
				 <div class="col-xs-3">
					 <small>企业申请指挥部ID ：</small>
					 <small  th:text="${company.companyApplyControId}"> </small>
				 </div>
			 </h2>
		 </div>
		<div class="row">
			<div class="col-sm-12 search-collapse">
				<form id="formId" th:object="${people}">
					<div class="select-list">
						<ul>
							<li>
								姓名：<input type="text" name="peopleName"/>
							</li>

							<li>
								身份证号：<input type="text" name="peopleIdCard"/>
							</li>
							<li>
								手机号：<input type="text" name="peopleConnectPhone"/>
							</li>
							<li class="hide">
								企业信息ID：<input id="companyId"  type="text" th:field="*{companyId}" name="companyId"/>
							</li>
							<li>
								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
							</li>
						</ul>
					</div>
				</form>
			</div>
			<div class="hide">
				<form id="pc" th:object="${pc}">
					<div class="select-list">
						<input id="pcId" type="text" th:field="*{pcId}"  name="pcId"/>
						<input id="applyStatusOne" th:field="*{applyStatusOne}"  type="text"   name="applyStatusOne"/>
					</div>
				</form>
			</div>
	        <div class="btn-group-sm hidden-xs" id="toolbar" role="group">
				<a class="btn btn-success hide" id="addPoeple" onclick="$.operate.add()" shiro:hasPermission="system:people:add">
					<i class="fa fa-plus"></i> 添加
				</a>
				<a class="btn btn-primary btn-edit hide" id="submit" onclick="submitPc()" shiro:hasPermission="system:pc:edit">
					<i class="fa fa-edit"></i> 提交
				</a>
			</div>
			<div class="col-sm-12 select-table table-striped">
				<table id="bootstrap-table" data-mobile-responsive="true"></table>
			</div>
		</div>
	</div>
    <div th:include="include :: footer"></div>
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('system:people:edit')}]];
        var removeFlag = [[${@permission.hasPermi('system:people:remove')}]];
        var peopleOne = [[${@permission.hasPermi('system:peopleOne:view')}]];
        var prefix = ctx + "system/people";
        function submitPc(){
        	var pc_Id= $("#companyId").val();
			if(!$('#bootstrap-table').bootstrapTable("getData").length){
				$.modal.msg("至少有一条员工信息");
				return;
			}
			$.modal.confirm("确定要提交这一批次员工么，提交后不能修改哦",function(a){
				$.ajax({
					type: "post",
					url:  "/system/pc/edit",
					data: {
						pcId:pc_Id,
						applyStatusOne:'已提交'
					},
					success: function(r) {
						$.modal.msg("审批已提交");
						location.reload();
					}
				});
			})

        }

        $(function() {
            var pcId = $("#pcId").val();
            pcId= parseInt(pcId);
            var options = {
				url: prefix + "/list/"+pcId,
				createUrl: prefix + "/add/"+pcId,
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
				exportUrl: prefix + "/export",
                modalName: "返岗人员",
				search:false,
				showRefresh:false,
				showColumns:false,
				showToggle:false,
				showSearch:false,
				showExport: true,
				showDropdown:true,
                columns: [{
		            checkbox: true
		        },
                    {
                        field : 'peopleIdCard',
                        title : '身份证号',
                        sortable: true
                    },
                    {
                        field : 'peopleName',
                        title : '姓名',
                        sortable: true
                    },
                    {
                        field : 'peopleConnectPhone',
                        title : '手机号',
                        sortable: true
                    },
					{
						field : 'aera',
						title : '现住地市行政区划代码',
						sortable: true
					},


					{
                        field : 'peopleJob',
                        title : '岗位（工种）',
                        sortable: true
                    },
                    {
                        field : 'propleType',
                        title : '人员类型',
                        sortable: true
                    },
                    {
                        field : 'peopleCarLicense',
                        title : '车辆牌照号',
                        sortable: true
                    },
                    {
                        field : 'carType',
                        title : '车辆类型',
                        sortable: true
                    },
                    {
                        field : 'applyTime',
                        title : '申请返回时间',
                        sortable: true
                    },
                    {
                        field : 'nowAddressHealth',
                        title : '现居留地县指挥部健康证明（是/否）',
                        sortable: true
                    },
				   {
					field : 'peopleFillTime',
					title : '填报时间',
					sortable: true
				},
		        {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        var applyStatusOne= $("#applyStatusOne").val();
						if(!applyStatusOne||applyStatusOne=="审核不通过"||applyStatusOne=="未提交"){
                            actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.peopleId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                            actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.peopleId + '\')"><i class="fa fa-remove"></i>删除</a>');
                        }
                        var a='/system/people/'+row.peopleId;
                        actions.push(' <a class="btn btn-success btn-xs ' + peopleOne + '" href="#" onclick="$.operate.showInfo(\'' + a + '\')"><i class="fa fa-search"></i>查看</a> ');
                        return actions.join('');
                    }
		        }]
            };
            var applyStatusOne= $("#applyStatusOne").val();
            if(!applyStatusOne||applyStatusOne=="审核不通过"||applyStatusOne=="未提交"){
                $("#submit").removeClass("hide")
                $("#addPoeple").removeClass("hide")

            }else{

            }
            $.table.init(options);
        });
    </script>
</body>
</html>